diff options
Diffstat (limited to 'app/[lng]/evcp/(evcp)/information/page.tsx')
| -rw-r--r-- | app/[lng]/evcp/(evcp)/information/page.tsx | 108 |
1 files changed, 51 insertions, 57 deletions
diff --git a/app/[lng]/evcp/(evcp)/information/page.tsx b/app/[lng]/evcp/(evcp)/information/page.tsx index db383c32..c87471ae 100644 --- a/app/[lng]/evcp/(evcp)/information/page.tsx +++ b/app/[lng]/evcp/(evcp)/information/page.tsx @@ -1,58 +1,52 @@ -import * as React from "react"
-import type { Metadata } from "next"
-import { unstable_noStore as noStore } from "next/cache"
-
-import { Shell } from "@/components/shell"
-import { getInformationLists } from "@/lib/information/service"
-import { InformationClient } from "@/components/information/information-client"
-import { InformationButton } from "@/components/information/information-button"
-
-export const metadata: Metadata = {
- title: "인포메이션 관리",
- description: "페이지별 도움말 및 첨부파일을 관리합니다.",
-}
-
-interface InformationPageProps {
- params: Promise<{ lng: string }>
-}
-
-export default async function InformationPage({ params }: InformationPageProps) {
- noStore()
-
- const { lng } = await params
-
- // 초기 데이터 로딩
- const initialData = await getInformationLists({
- page: 1,
- perPage: 500,
- search: "",
- sort: [{ id: "createdAt", desc: true }],
- flags: [],
- filters: [],
- joinOperator: "and",
- pagePath: "",
- pageName: "",
- informationContent: "",
- isActive: null,
- from: "",
- to: "",
- })
-
- return (
- <Shell className="gap-2">
- <div className="flex items-center justify-between space-y-2">
- <div className="flex items-center justify-between space-y-2">
- <div>
- <div className="flex items-center gap-2">
- <h2 className="text-2xl font-bold tracking-tight">
- 인포메이션 관리
- </h2>
- <InformationButton pagePath="/evcp/information" />
- </div>
- </div>
- </div>
- </div>
- <InformationClient lng={lng} initialData={initialData?.data || []} />
- </Shell>
- )
+import * as React from "react" +import type { Metadata } from "next" +import { unstable_noStore as noStore } from "next/cache" + +import { Shell } from "@/components/shell" +import { getInformationLists } from "@/lib/information/service" +import { InformationClient } from "@/components/information/information-client" +import { InformationButton } from "@/components/information/information-button" +import { useTranslation } from "@/i18n" + +export const metadata: Metadata = { + title: "인포메이션 관리", + description: "페이지별 도움말 및 첨부파일을 관리합니다.", +} + +interface InformationPageProps { + params: Promise<{ lng: string }> +} + +export default async function InformationPage({ params }: InformationPageProps) { + noStore() + + const { lng } = await params + const { t } = await useTranslation(lng, 'menu') + + // 초기 데이터 로딩 (간단화) + const initialData = await getInformationLists() + + // 서버사이드에서 번역된 데이터 생성 + const translatedData = initialData?.data?.map(item => ({ + ...item, + translatedPageName: t(item.pageName) + })) || [] + + return ( + <Shell className="gap-2"> + <div className="flex items-center justify-between space-y-2"> + <div className="flex items-center justify-between space-y-2"> + <div> + <div className="flex items-center gap-2"> + <h2 className="text-2xl font-bold tracking-tight"> + 인포메이션 관리 + </h2> + <InformationButton pagePath="/evcp/information" /> + </div> + </div> + </div> + </div> + <InformationClient initialData={translatedData} /> + </Shell> + ) }
\ No newline at end of file |
